<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>Picking Order</title>
    </h:head>
    <f:view beforePhase="#{UserDisplayManagedBean.doDisplay}">
        <f:view beforePhase="#{PickingOrderManagedBean.initView}">
            <h:body>
                <h:form prependId="false">
                    <p:growl id="msgs" showDetail="true"/>
                    <p:growl id="notif" showDetail="true"/>
                    <div id="top" class="top">
                        <h:graphicImage value="/image/newHeader.jpg"/>
                    </div>
                    <div id="content">
                        <p:poll interval="5"   
                                actionListener="#{MessageManagedBean.checkNewMessage}" immediate="true" update="notif" />
                        <table >
                            <tr><td>
                                    <p:toolbar style="background-color:darkred;font-size:70%;height:25px;width:100%"> 
                                        <p:toolbarGroup align="right">
                                            <p:button title="Home" image="ui-icon-home" outcome ="InventoryDeptWorkspace"/>                                  
                                            <p:button title="Notes" image="ui-icon-note" outcome="tasks"/>                                    
                                            <p:button title="Mail" outcome="messages"  image="ui-icon-mail-closed" />                                   
                                            <p:button title="Edit Preferences" image="ui-icon-gear"/>                                   
                                            <p:button title="Help" image="ui-icon-help"/>
                                            <p:commandButton title="Log Out" immediate="true" type="submit" image="ui-icon-close" actionListener="#{UserManagedBean.doLogout}"/> 
                                        </p:toolbarGroup>
                                    </p:toolbar></td>
                                <td>
                                    <h:graphicImage value="warehouse.gif" style="width:35px;height:35px" />
                                    <h:outputText value="         "/>
                                    <h:outputText value="Picking Orders" style="font-family:Tahoma;font-size:20px;font-weight:bolder"/>
                                    <p:spacer width="100" height="10"/>
                                </td>
                            </tr>
                            <tr>

                                <td style="vertical-align:top">
                                    <p:menu style="width:200px;font-size: 12px;font-family: Tahoma;border-style: ridge">  
                                        <p:submenu label="Inventories" > 
                                            <p:menuitem value="New Product" url="http://localhost:8080/MerlionERP-war/SCM/addProduct.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>  
                                            <p:menuitem value="View All Products" url="http://localhost:8080/MerlionERP-war/SCM/products.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>  
                                            <p:menuitem value="New Material" url="http://localhost:8080/MerlionERP-war/SCM/addMaterial.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>                                      
                                            <p:menuitem value="View All Materials" url="http://localhost:8080/MerlionERP-war/SCM/materials.xhtml" ajax="false" icon="ui-icon ui-icon-tag" />
                                            <p:menuitem value="View Unhoused Inventories" url="http://localhost:8080/MerlionERP-war/SCM/unhousedInventories.xhtml" ajax="false" icon="ui-icon ui-icon-tag" />
                                            <p:menuitem value="View Inventory Movements" url="http://localhost:8080/MerlionERP-war/SCM/inventoryMovements.xhtml" ajax="false" icon="ui-icon ui-icon-tag" />

                                        </p:submenu>
                                        <p:submenu label="Warehouses" >
                                            <p:menuitem value="New Warehouse" url="http://localhost:8080/MerlionERP-war/SCM/addWarehouse.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>        
                                            <p:menuitem value= "View All Warehouses" url="http://localhost:8080/MerlionERP-war/SCM/warehouses.xhtml" ajax="false" icon="ui-icon ui-icon-tag" />
                                        </p:submenu>
                                        <p:submenu label="Shipments and Orders">
                                            <p:menuitem value="Delivery Orders" url="http://localhost:8080/MerlionERP-war/SCM/deliveryOrders.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>
                                            <p:menuitem value="Picking Orders" url="http://localhost:8080/MerlionERP-war/SCM/pickingOrders.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>            
                                        </p:submenu>
                                    </p:menu>
                                    <p:calendar mode="inline" style="font-size:11px;font-family:Tahoma"/>
                                </td>

                                <td style="vertical-align:top">

                                    <p:toolbar style="background-color:  #d9bb73;font-size: 70%;width:99.5%"> 
                                        <p:toolbarGroup align="left">  
                                          <!-- <p:button value="New Picking Order" outcome="addPickingOrder" image="ui-icon-plus"/>-->
                                            <p:commandButton value="Delete" title="Delete" image="ui-icon ui-icon-trash" oncomplete="deleteDialogs.show()"/>                                   
                                        </p:toolbarGroup>  
                                    </p:toolbar> 

                                    <p:dataTable id="panel" 
                                                 var="pickingOrders" value="#{PickingOrderManagedBean.pickingOrderList}"                       
                                                 paginator="true" rows="5"  
                                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                                 rowEditListener="#{PickingOrderManagedBean.onEditRowPickingOrder}"
                                                 rowsPerPageTemplate="5,10,15"  style="font-size:60%;width:100%"
                                                 selection="#{PickingOrderManagedBean.selectedPickingOrders}"
                                                 emptyMessage="No data found with given criteria" widgetVar="pickingOrderTable">  

                                        <f:facet name="header">                           
                                            <p:outputPanel style="text-align:right"  >
                                                <h:outputText value="Search all fields:" style="margin-left:840px" />  
                                                <p:inputText id="globalFilter" onkeyup="pickingOrderTable.filter()" style="right:-100px;width:150px" />  
                                            </p:outputPanel>
                                        </f:facet> 

                                        <p:column selectionMode="multiple"/> <!-- style="border-left-color:transparent;border-right-color:transparent"/>-->


                                        <p:column headerText="View" style="width:20px;border-right-color:transparent">  
                                            <p:rowToggler />  
                                        </p:column>


                                        <p:column headerText="Edit" style="width:20px;border-left-color:transparent;border-right-color:transparent">    
                                            <p:rowEditor/>
                                        </p:column>


                                        <p:column headerText="Del." style="width: 16px;border-left-color:transparent">
                                            <!--DELETE-->
                                            <p:commandButton title="Delete" image="ui-icon ui-icon-trash" ajax="true" immediate="true"
                                                             update="panel" oncomplete="deleteDialog.show()">
                                                <f:setPropertyActionListener target="#{PickingOrderManagedBean.selectedPickingOrder}"
                                                                             value="#{pickingOrders}"/>
                                            </p:commandButton>
                                        </p:column>



                                        <p:column sortBy="#{pickingOrders.id}" filterBy="#{pickingOrders.id}" 
                                                  filterMatchMode="contains"  >
                                            <!--style="border-left-color:transparent;border-right-color:transparent">-->
                                            <f:facet name="header">
                                                <h:outputText value="ID"/>
                                            </f:facet>
                                            <h:outputText value="#{pickingOrders.id}"/>
                                        </p:column>

                                        <!--DATE ISSUED-->
                                        <p:column headerText="Date Issued" sortBy="#{pickingOrders.issueDate}" 
                                                  filterBy="#{pickingOrders.issueDate}" filterMatchMode="contains">

                                            <h:outputText value="#{pickingOrders.issueDate}" />  

                                        </p:column>   


                                        <p:column headerText="Date Due" sortBy="#{pickingOrders.dueDate}" 
                                                  filterBy="#{pickingOrders.dueDate}" filterMatchMode="contains">
                                            <!--style="border-left-color:transparent;border-right-color:transparent"-->  
                                            <p:cellEditor>
                                                <f:facet name="output">  
                                                    <h:outputText value="#{pickingOrders.dueDate}" />  
                                                </f:facet>  
                                                <f:facet name="input">

                                                    <p:calendar value="#{pickingOrders.dueDate}" pattern="dd/MM/yyyy" />
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>   



                                        <!--CLIENT NAME-->
                                        <p:column headerText="Target Warehouse" sortBy="#{pickingOrders.targetWarehouseId}" 
                                                  filterBy="#{pickingOrders.targetWarehouseId}" filterMatchMode="contains">
                                            <!--style="border-left-color:transparent;border-right-color:transparent"-->
                                            <p:cellEditor>
                                                <f:facet name="output">
                                                    <h:outputText value="#{pickingOrders.targetWarehouseId} - #{pickingOrders.targetWarehouseName}"/>
                                                </f:facet>

                                                <f:facet name="input">
                                                    <h:selectOneMenu value="#{pickingOrders.targetWarehouseId}" > 
                                                        <f:selectItems value="#{PickingOrderManagedBean.warehouses}" var="war"
                                                                       itemValue="#{war.id}" itemLabel="#{war.id}-#{war.name}"/>
                                                    </h:selectOneMenu>
                                                </f:facet>
                                            </p:cellEditor> 
                                        </p:column>

                                        <!--STATUS-->
                                        <p:column headerText="Status" sortBy="#{pickingOrders.status}" 
                                                  filterBy="#{pickingOrders.status}" filterMatchMode="contains">
                                            <!-- style="border-left-color:transparent;border-right-color:transparent"-->
                                            <p:cellEditor>
                                                <f:facet name="output">
                                                    <h:outputText value="#{pickingOrders.status}"/>
                                                </f:facet>
                                                <f:facet name="input">            
                                                    <h:selectOneMenu value="#{pickingOrders.status}">
                                                        <f:selectItem itemLabel="In Progress"   itemValue="In Progress"/> 
                                                        <f:selectItem itemLabel="Picked"        itemValue="Picked"/>                               
                                                        <f:selectItem itemLabel="Voided"        itemValue="Voided"/>                                  

                                                    </h:selectOneMenu>
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>


                                        <p:column headerText="Delivery Order ID" sortBy="#{pickingOrders.deliveryOrderId}" 
                                                  filterBy="#{pickingOrders.deliveryOrderId}" filterMatchMode="contains"
                                                  filterStyle="width:50px"> 
                                            <!--style="border-left-color:transparent;border-right-color:transparent">-->                                     
                                            <h:outputText value="#{pickingOrders.deliveryOrderId}" />   
                                        </p:column>   

                                        <p:column style="width:20px">  
                                            <p:commandLink update="display1 childPanel"  oncomplete="editDialog.show()" title="Edit Details">
                                                <p:graphicImage value="clipboard.png" style="width:20px;height:20px"/>
                                                <f:setPropertyActionListener value="#{pickingOrders}" target="#{PickingOrderManagedBean.selectedViewPickingOrder}" />  
                                                <f:setPropertyActionListener value="#{true}" target="#{PickingOrderManagedBean.editMode}" />  
                                            </p:commandLink>                                                                
                                        </p:column>

                                        <p:column style="width:20px">  
                                            <p:commandLink update="entryPanel entrytable"  oncomplete="entryDialog.show()" title="Picking ORders">
                                                <p:graphicImage value="box.png" style="width:20px;height:20px"/>
                                                <f:setPropertyActionListener value="#{pickingOrders}" target="#{PickingOrderManagedBean.selectedViewPickingOrder}" />  

                                            </p:commandLink>                                                                
                                        </p:column>

                                        <p:column style="width:20px">  
                                            <p:commandButton  image="ui-icon ui-icon-check" update="executePOPanel" oncomplete="executePODialog.show()" title="Execute Picking Order">

                                                <f:setPropertyActionListener value="#{pickingOrders}" target="#{PickingOrderManagedBean.selectedViewPickingOrder}" />  

                                            </p:commandButton>                                                                
                                        </p:column>

                                        <p:rowExpansion>  
                                            <h:panelGrid id="display" columns="3" cellpadding="3"
                                                         style="font-family:Tahoma; font-size:10px;border-color:transparent;column-rule-style:hidden">

                                                <h:outputText value="Picking Order Id" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{pickingOrders.id}" />

                                                <h:outputText value="Date Issued" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{pickingOrders.issueDate}" />

                                                <h:outputText value="Date Due" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{pickingOrders.dueDate}" />

                                                <h:outputText value="Picking Route" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{pickingOrders.pickingRoute}" /> 

                                                <h:outputText value="Picking Method" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{pickingOrders.pickingMethod}" />

                                                <h:outputText value="Target Warehouse Id" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{pickingOrders.targetWarehouseId}" /> 


                                                <h:outputText value="Status" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{pickingOrders.status}" />


                                                <h:outputText value="Delivery Order ID" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{pickingOrders.deliveryOrderId}" />

                                            </h:panelGrid>  
                                        </p:rowExpansion> 
                                    </p:dataTable> 

                                    <p:dialog modal="true" header="Execute Picking Order" height="200" width="300" widgetVar="executePODialog" >
                                        <center>
                                            <h:panelGrid columns="3" id="executePOPanel" style="font-family:Tahoma;font-size: 12px">
                                                <h:outputText style="text-align: center" value="Are you sure you want to execute this picking order?"/>
                                                <h:outputText value=""/>
                                                <h:outputText value=""/>

                                                <h:outputText value=""/>
                                                <h:outputText value=""/>
                                                <h:outputText value=""/>

                                                <h:outputText value=""/>
                                                <h:outputText value=""/>
                                                <h:outputText value=""/>

                                                <h:outputText value=""/>
                                                <p:commandButton value="Execute" oncomplete="executePODialog.hide()" ajax="true" immediate="true"
                                                                 update="msgs" actionListener="#{PickingOrderManagedBean.executePickingOrder}"/>
                                                <p:commandButton value="Cancel" onclick="executePODialog.hide()"/>
                                            </h:panelGrid>
                                        </center>
                                    </p:dialog>

                                    <p:dialog modal="true" header="Picking Order Entries" widgetVar="entryDialog" width="1200" >
                                        <p:panel id="entryPanel" style="font-family:Tahoma;font-size:10px;width:100%">

                                            <p:dataTable id="entrytable" value="#{PickingOrderManagedBean.selectedProductList}"
                                                         rowEditListener="#{PickingOrderManagedBean.onEditLineEntry}"
                                                         var="lineEntry" style="width:100%"
                                                         paginator="true" rows="5"  
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  

                                                         rowsPerPageTemplate="5,10,15">

                                                <p:column style="width:50px" headerText="Product ID">
                                                    <h:outputText value ="#{lineEntry.productId}"/>
                                                </p:column>



                                                <p:column headerText="Status">
                                                    <p:cellEditor>
                                                        <f:facet name="output">
                                                            <h:outputText value="#{lineEntry.status}"/>
                                                        </f:facet>
                                                        <f:facet name="input">
                                                            <h:selectOneMenu value="#{lineEntry.status}">
                                                                <f:selectItem itemLabel="Pending" itemValue="Pending"/>
                                                                <f:selectItem itemLabel="Ready" itemValue="Ready"/>
                                                                <f:selectItem itemLabel="Picked" itemValue="Picked"/>
                                                            </h:selectOneMenu>   
                                                        </f:facet>
                                                    </p:cellEditor>
                                                </p:column>


                                                <p:column headerText="Warehouse">
                                                    <p:cellEditor>
                                                        <f:facet name="output">
                                                            <h:outputText value="#{lineEntry.warehouseId} - #{lineEntry.warehouseName}"/>
                                                        </f:facet>
                                                        <f:facet name="input">
                                                            <h:selectOneMenu value="#{lineEntry.warehouseId}">
                                                                <f:selectItems value="#{PickingOrderManagedBean.warehouses}" var="war"
                                                                               itemLabel="#{war.id} - #{war.name}" itemValue="#{war.id}"/>
                                                            </h:selectOneMenu>   
                                                        </f:facet>
                                                    </p:cellEditor>
                                                </p:column>


                                                <p:column headerText="Picking Date">
                                                    <p:cellEditor>
                                                        <f:facet name="output">
                                                            <h:outputText value="#{lineEntry.pickingDate}"/>
                                                        </f:facet>
                                                        <f:facet name="input">
                                                            <p:calendar value="#{lineEntry.pickingDate}" pattern="dd/MM/yyyy" />
                                                        </f:facet>
                                                    </p:cellEditor>
                                                </p:column>

                                                <p:column style="width:50px" headerText="Requested Quantity">

                                                    <h:outputText value="#{lineEntry.requestedQty}"/>

                                                </p:column>

                                                <p:column style="width:50px" headerText="Picking Quantity">

                                                    <h:outputText value="#{lineEntry.pickingQty}"/>

                                                </p:column>

                                                <p:column style="width:50px" headerText="Reservation Type">
                                                    <h:outputText value="#{lineEntry.reservationType}"/>
                                                </p:column>

                                                <p:column headerText="Reservation Id">
                                                    <h:outputText value="#{lineEntry.reservationId}"/>
                                                </p:column>

                                                <p:column headerText="Availability Date">
                                                    <h:outputText value="#{lineEntry.availabilityDate}"/>
                                                </p:column>

                                                <p:column style="width:20px; border-left-style: transparent">    
                                                    <p:rowEditor/>
                                                </p:column>

                                                <p:column>
                                                    <p:commandButton value="Delete" image="ui-icon ui-icon-trash"
                                                                     ajax="true" immediate="true" update="panel"
                                                                     onclick="entrydialog.show()">
                                                        <f:setPropertyActionListener target="#{PickingOrderManagedBean.selectedPickingOrderEntryState}"
                                                                                     value="#{lineEntry}"/>
                                                    </p:commandButton>
                                                </p:column>

                                            </p:dataTable>
                                        </p:panel>
                                    </p:dialog>

                                    <p:ajaxStatus style="width:16px;height:16px;">  
                                        <f:facet name="start">  
                                            <h:graphicImage value="25(2).gif" />  
                                        </f:facet>  

                                        <f:facet name="complete">  
                                            <h:outputText value="" />  
                                        </f:facet>  
                                    </p:ajaxStatus> 

                                    <p:confirmDialog message="Are you sure you want to delete this entry?"  
                                                     showEffect="blind" hideEffect="blind" modal="true"
                                                     header="Delete entry" severity="alert" widgetVar="entrydialog">  
                                        <center>
                                            <p:commandButton value="Yes" update="panel" ajax="true" immediate="true" 
                                                             oncomplete="entrydialog.hide()"  
                                                             actionListener="#{PickingOrderManagedBean.withdrawPickingOrderEntry}" />  
                                            <p:commandButton value="No" onclick="entrydialog.hide()" type="button" />   
                                        </center>
                                    </p:confirmDialog> 

                                    <p:dialog modal="true" header="Picking Order Detail" widgetVar="editDialog" resizable="true"  
                                              width="900" >  
                                        <center>
                                            <h:panelGrid id="display1" columns="6" cellpadding="4" cellspacing="4" style="font-family:Tahoma;font-size:12px" >  

                                                <h:outputText value="ID" style="font-weight:bold"/> 
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{PickingOrderManagedBean.selectedViewPickingOrder.id}" />  

                                                <h:outputText value=""/>
                                                <h:outputText value=""/>

                                                <h:outputText value=""/>

                                                <h:outputText value="Date Issued" style="font-weight:bold"/>
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{PickingOrderManagedBean.selectedViewPickingOrder.issueDate}"/>

                                                <h:outputText value="Date Due" style="font-weight:bold"/>
                                                <h:outputText value=":"/>
                                                <h:panelGroup>
                                                    <h:outputText value="#{PickingOrderManagedBean.selectedViewPickingOrder.dueDate}"
                                                                  style="font-weight:bold" rendered="#{!PickingOrderManagedBean.editMode}"/>
                                                    <p:calendar value="#{PickingOrderManagedBean.selectedViewPickingOrder.dueDate}"
                                                                rendered="#{PickingOrderManagedBean.editMode}" required="true"/>
                                                </h:panelGroup>

                                                <h:outputText value="Target Warehouse" style="font-weight:bold"/> 
                                                <h:outputText value=":"/>                                  
                                                <h:panelGroup>  
                                                    <h:outputText value="#{PickingOrderManagedBean.selectedViewPickingOrder.targetWarehouseId} - #{PickingOrderManagedBean.selectedViewPickingOrder.targetWarehouseName}" style="font-weight:bold" rendered="#{!PickingOrderManagedBean.editMode}"/>  
                                                    <h:selectOneMenu value="#{PickingOrderManagedBean.selectedViewPickingOrder.targetWarehouseId}"
                                                                     rendered="#{PickingOrderManagedBean.editMode}">  

                                                        <f:selectItem itemLabel="Select Warehouse" itemValue=""/>
                                                        <f:selectItems value="#{PickingOrderManagedBean.warehouses}" var="war"
                                                                       itemLabel ="#{war.id} - #{war.name}" itemValue="#{war.id}"/>    
                                                    </h:selectOneMenu>

                                                </h:panelGroup>

                                                <h:outputText value=""/>
                                                <h:outputText value=""/>

                                                <h:outputText value=""/>

                                                <h:outputText value="Picking Route" style="font-weight:bold"/> 
                                                <h:outputText value=":"/>
                                                <h:panelGroup>  
                                                    <h:outputText value="#{PickingOrderManagedBean.selectedViewPickingOrder.pickingRoute}" style="font-weight:bold" rendered="#{!PickingOrderManagedBean.editMode}"/>  
                                                    <h:selectOneMenu  value="#{PickingOrderManagedBean.selectedViewPickingOrder.pickingRoute}" rendered="#{PickingOrderManagedBean.editMode}">
                                                        <f:selectItem itemLabel="Route 1" itemValue="Route 1"/> 
                                                        <f:selectItem itemLabel="Route 2" itemValue="Route 2"/>                                         
                                                        <f:selectItem itemLabel="Route 3" itemValue="Route 3"/>       
                                                    </h:selectOneMenu>  
                                                </h:panelGroup>  

                                                <h:outputText value="Picking Method" style="font-weight:bold"/> 
                                                <h:outputText value=":"/>
                                                <h:panelGroup>  
                                                    <h:outputText value="#{PickingOrderManagedBean.selectedViewPickingOrder.pickingMethod}" 
                                                                  style="font-weight:bold"/>                                        
                                                </h:panelGroup>

                                                <h:outputText value="Status" style="font-weight:bold"/>
                                                <h:outputText value=":"/>
                                                <h:panelGroup>
                                                    <h:outputText value="#{PickingOrderManagedBean.selectedViewPickingOrder.status}" style="font-weight:bold" rendered="#{!PickingOrderManagedBean.editMode}"/>
                                                    <h:selectOneMenu  value="#{PickingOrderManagedBean.selectedViewPickingOrder.status}" rendered="#{PickingOrderManagedBean.editMode}">
                                                        <f:selectItem itemLabel="In Progress" itemValue="In Progress"/> 
                                                        <f:selectItem itemLabel="Picked" itemValue="Picked"/>                                         
                                                        <f:selectItem itemLabel="Voided" itemValue="Voided"/>       
                                                    </h:selectOneMenu>
                                                </h:panelGroup>


                                                <h:outputText value="Delivery Order ID" style="font-weight:bold"/>
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{PickingOrderManagedBean.selectedViewPickingOrder.deliveryOrderId}"/>



                                                <p:outputPanel rendered="#{PickingOrderManagedBean.editMode}" layout="block" style="text-align:right">  
                                                    <p:commandButton value="Save" update="panel" actionListener="#{PickingOrderManagedBean.editPickingOrder}"   
                                                                     oncomplete="editDialog.hide()" image="ui-icon ui-icon-check" />  
                                                    <p:commandButton value="Cancel" onclick="editDialog.hide()" type="button" image="ui-icon ui-icon-close"/>  
                                                </p:outputPanel> 

                                            </h:panelGrid>  
                                        </center>
                                    </p:dialog>

                                    <!--DIALOG FOR DELETING A  SINGLE ROW-->
                                    <p:confirmDialog message="Are you sure you want to delete this picking order?"  
                                                     showEffect="blind" modal="true" hideEffect="blind"  
                                                     header="Delete Picking Order" severity="alert" widgetVar="deleteDialog">  
                                        <center>
                                            <p:commandButton value="Yes" update="panel" ajax="true" immediate="true" oncomplete="deleteDialog.hide()"  
                                                             actionListener="#{PickingOrderManagedBean.deletePickingOrder}" />  
                                            <p:commandButton value="No" onclick="deleteDialog.hide()" type="button" />   
                                        </center>

                                    </p:confirmDialog>  


                                    <!--DIALOG FOR DELETING MULTIPLE ROW OF Picking ORDERS-->
                                    <p:dialog header="Delete Selected Records" modal="true" widgetVar="deleteDialogs">

                                        <h:outputText value="You are about to permanently delete records." /><br /><br />
                                        <h:outputText value="Are you sure you want to continue?" /><br /><br/>

                                        <center>
                                            <p:commandButton value="Yes" ajax="true" immediate="true" update="panel" 
                                                             oncomplete="deleteDialogs.hide()" actionListener="#{PickingOrderManagedBean.deletePickingOrders}" />
                                            <p:commandButton value="No" oncomplete="deleteDialogs.hide()" action="#{PickingOrderManagedBean.cancelDelete()}" /> 

                                        </center>
                                    </p:dialog>


                                </td>
                            </tr>
                        </table>

                    </div>
                    <div id="bottom" class="bottom">
                        <h:graphicImage value="/image/merlionfooter.jpg"/>
                    </div>
                </h:form>
            </h:body>
        </f:view>
    </f:view>
</html>